<template>
  <div class="footer">
      <van-tabbar v-model="active" active-color="#1BAEAE">
        <van-tabbar-item icon="home-o" to="/home">首页</van-tabbar-item>
        <van-tabbar-item icon="search" to="/menu">
			 <span>分类</span>
			 <template #icon="props">
			    <div class="icon iconfont icon-fenlei"></div>
			 </template>
		</van-tabbar-item>
        <van-tabbar-item icon="cart-circle-o" to="/cart" :badge="cartnum">购物车</van-tabbar-item>
        <van-tabbar-item icon="friends-o" to="/my">我的</van-tabbar-item>
      </van-tabbar>
  </div>
</template>

<script>
export default {
  name: 'Footer',
  data(){
	  return{
		  active:0
	  }
  },
  created(){
	 this.$store.dispatch("asyncCartList")
  },
  computed:{
	  cartnum(){
		  return this.$store.getters.cartnum;
	  }
  }
}
</script>

<style lang="less" scoped>
	@import "../assets/icon.less";

</style>